Repository navigation
feat: disable destination GitHub Actions when enabled - #20
Merged
Merged
Conversation
vmvarela
force-pushed
the
feat/19-disable-destination-actions
branch
from
October 24, 2026 11:44
186624d to
7f84cff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When the destination reports GitHub Actions enabled,
gh replicatedisables them right before pushing the refs, so the commits it publishes cannot start a workflow there.The check reuses the existing
GET /repos/{owner}/{repo}/actions/permissions: an enabled answer is followed byPUTwith{"enabled": false}. Outcomes:Disabled GitHub Actions in <destination> for a passive mirror.;This is the same administration permission that changing the default branch needs.
Why
Replicating a repository pushes its workflow files. With Actions enabled the destination starts those workflows, which surprised us in practice: a mirror produced a draft release the source did not have. Since the destination of a replication is normally a passive mirror, disabling Actions is the correct default.
How tested
TestDisableDestinationActionscovers enabled (asserts the PUT body carriesenabled: false), already disabled, unreadable setting, and rejected update.TestRunReplicatesIntoDestinationruns the entrypoint with Actions enabled and requires exactly one update withenabled: false.TestRunDryRunLeavesDestinationUntouchedasserts the dry run reportsWould PUT .../actions/permissionsand sends nothing.TestRunLeavesDestinationUntouchedWhenPreflightFailsserves Actions enabled and still sees only GET requests, proving the update cannot happen before validation.go test -race -count=1 ./...,gofmt,go vet,go build,git diff --checkall clean.Known limit
Out of scope
Cancelling running jobs, re-enabling Actions, disabling individual workflows, external CI, and any other repository setting.
Closes #19